<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>表单返回</title>
    <link type="text/css" rel="stylesheet" href="CSS/main.css">
    <script type="text/javascript">
     function Gettext(){
        var Radio="";
        Radio=document.getElementById("text").value;
        document.getElementById("Result1").innerText = " 姓名：" + Radio;
        }


        function Getradio(){
            var R;
            R=document.getElementsByName("hy");
            for (var i = 0; i <= R.length-1; i++) {
                if (R[i].checked == true) {
                    document.getElementById("Result2").innerText = "行业：" + R[i].value;
                }
            }
        }


        function Getchecked(){
            var CK = document.getElementsByName("ah");
            var _result = "";
            for (var j = 0; j <= CK.length-1; j++) {
                if (CK[j].checked == true) {
                    _result += CK[j].value + "、";
                }
            }
            document.getElementById("Result3").innerText += "兴趣爱好：" + _result;
        }


        var Ah = document.getElementsByName("ah");
        function Checked(){
            var allchecked= document.getElementById("all");
            if (all.checked) {
                for (var i = 0; i <Ah.length; i++) {
                    if (Ah[i].type == "checkbox") {
                        Ah[i].checked = true;
                    }
                }
            } else {
                for (var i = 0; i <Ah.length; i++) {
                    if (Ah[i].type == "checkbox") {
                        Ah[i].checked = false;
                    }
                }
            }
        }
    </script>
</head>
<body>
    <div id="bigbox">
        <ul class="box">
            <li>
                <span>姓名</span>
                <input type="text" name="text" id="text" value="">
            </li>
            <li>
                <span>&nbsp;</span>
                <input type="radio" name="hy" value="软件技术">软件技术
                <input type="radio" name="hy" value="网络工程">网络工程
                <input type="radio" name="hy" value="商务营销">商务营销
            </li>
            <li>
                <span>所属行业</span>
                <input type="radio" name="hy" value="汽车维修">汽车维修
                <input type="radio" name="hy" value="机械制造">机械制造
                <input type="radio" name="hy" value="冶金矿产">冶金矿产
                <br>
                <span>&nbsp;</span>
                <input type="radio" name="hy" value="建筑">建筑
                <input type="radio" name="hy" value="林牧鱼">林牧鱼
            </li>
            <li>
                <span>兴趣爱好</span>
                <input type="checkbox" id="all" value="" onclick="Checked()">全选
                <br>
                <span>&nbsp;</span>
                <input type="checkbox" name="ah" value="">看书
                <input type="checkbox" name="ah" value="">打篮球
                <input type="checkbox" name="ah" value="">踢足球
                <br>
                <span>&nbsp;</span>
                <input type="checkbox" name="ah" value="">电子竞技
                <input type="checkbox" name="ah" value="">跑步
                <input type="checkbox" name="ah" value="">游泳
                <br>
                <span>&nbsp;</span>
                <input type="checkbox" name="ah" value="">旅游
                <input type="checkbox" name="ah" value="">购物


            </li>
            <li>
                <span>&nbsp;</span>
                <input type="button" value="确认" onclick="Gettext(),Getradio(),Getchecked()" class="qr">
            </li>
            <li>
                <div id="Result1"></div>
                <div id="Result2"></div>
                <div id="Result3"></div>
            </li>
        </ul>
    </div>
</body>
</html>